package com.taotao.rest.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.taotao.common.pojo.TaotaoResult;
import com.taotao.rest.service.IRedisSyncService;

/**
 * redis同步
 * 
 * @author Administrator
 *
 */
@Controller
@RequestMapping(value = "/redis/sync")
public class RedisSyncController {
	@Autowired
	private IRedisSyncService redisSyncService;

	/**
	 * 对首页大广告进行同步
	 */
	@RequestMapping(value = "/content/{categoryId}")
	@ResponseBody
	public TaotaoResult sycnContent(@PathVariable Integer categoryId) {
		TaotaoResult taotaoResult = this.redisSyncService
				.syncContent(categoryId);
		return taotaoResult;

	}

	// /**
	// * 对商品分类进行同步
	// */
	// @RequestMapping(value = "/item/cat/{key}")
	// @ResponseBody
	// public TaotaoResult sycnItemCat(@PathVariable String key) {
	// TaotaoResult taotaoResult = this.redisSyncService.syncItemCat(key);
	// return taotaoResult;
	//
	// }
}
